home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.3 / Video Toaster v4.3.iso / 4.2 / arexx / editor / oz / 33-grp-adj < prev    next >
Text File  |  1998-04-16  |  3KB  |  108 lines

  1. /* Grp_Adjust.rexx V1.3 -- Allows you to adjust the start point of a set of linked audio clips.  You can move the whole set & maintain their delays & fade points. */
  2.  
  3. /* by Aussie -  ©1995 Michael Holten        
  4.  
  5.     To use: find a set of AUDIO clips in your project that are together in a row, highlight one of them (usually the first) and run this ARexx routine.  You can adjust the highlighted clip's start time and every AUDIO clip that follows in the set will change also, to maintain the same delay.  
  6.  
  7.     Notes: This routine starts at the highlighted clip and stops at the first NON AUDIO clip. (e.g. effect, stop, still, video etc.)            
  8.  
  9.     It is presumed that you wish to maintain everything else about the set of clips, so this routine ONLY changes 'start times' it does not alter the 'lock to' mode of any clip.
  10.  
  11. */
  12.  
  13.  
  14. call remlib('PROJECT_REXX_PORT')
  15. call addlib('PROJECT_REXX_PORT',0)
  16.  
  17.  
  18. /* --- begin --- */
  19. start_loc=croutonspot()
  20. call croutonpick(LAST)
  21. project_end=croutonsinproject()
  22. current_spot=start_loc
  23.  
  24.  
  25. /* --- Read current audio clip --- */
  26. call croutonpick(current_spot)
  27.  
  28.  
  29. /* --- wait for any screen update delay --- */
  30. call time('R')
  31. do while (time('E')<0.5)
  32.     end
  33.  
  34. /* --- test for audio clip --- */
  35. call req_open("Grp-Adjust - by Aussie","----------------","  Allows you to adjust the start time of a set of AUDIO clips.  "," (Starts at selected clip & stops at first non-audio clip)  ")
  36.  
  37. if croutontype()~=" AUD" then do
  38.    call req_tell("Nope.  The selected clip..."," must be an AUDIO ONLY crouton!")
  39.    call req_close()
  40.    call quit
  41.    end
  42.  
  43. prevstart=croutongettag(Delay)
  44. prevf_start=prevstart/2
  45. f_want=req_time("Re-set start time:",prevf_start)
  46. if f_want="CANCEL" then do
  47.    call req_close()
  48.    call quit()
  49.    end
  50.  
  51. fm=substr(f_want,4,2)
  52. fs=substr(f_want,7,2)
  53. ff=substr(f_want,10,2)
  54. f_all=((fm*1800)+(fs*30)+ff)*2
  55. change=f_all-prevstart
  56. f_change=change/2
  57. changesign=""
  58. if change>0 then changesign="+"
  59.  
  60. /* Proceed or not */
  61. test=req_tell("New start time: " f_want ,"Adjust start times " changesign f_change "frames?")
  62. call req_close()
  63. if test=0 then call quit()
  64.  
  65. isaudio=1
  66. current_temp=current_spot
  67.  
  68. /* --- loop starts --- */
  69. do while isaudio=1
  70.    isaudio=0
  71.  
  72. /* --- set following audio clips start points --- */
  73.    call croutonpick(current_spot)
  74.    current_spot=current_spot+1
  75.    if croutontype()=" AUD" then isaudio=1
  76.    if isaudio=1 then do
  77.       prevstart=croutongettag(Delay)
  78.       prevstart=prevstart + change
  79.       if prevstart<0 then do
  80.          call req_tell("<<< Halted >>>","A clip could not be set below zero!")
  81.          call quitb()
  82.          end
  83.       call croutonsettag(Delay,PrevStart)
  84.  
  85. /* --- Set up next link --- */
  86.       current_temp=current_spot
  87.       if current_spot=project_end+1 then isaudio=0
  88.       end
  89.    end
  90.  
  91.  
  92. /* --- Wrap Up --- */
  93. quita:
  94. call projectupdate()
  95. call croutonpick(start_loc)
  96. call req_error(" OZ:     All Done!    <<< Linked clips have new start times >>>")
  97. call remlib("PROJECT_REXX_PORT")
  98. exit
  99.  
  100. quit:
  101. call croutonpick(start_loc)
  102. call req_error(" OZ:     <<< Last Operation Canceled >>>")
  103.  
  104. quitb:
  105. call remlib("PROJECT_REXX_PORT")
  106.  
  107. exit
  108.